function M = cmc(L, Ip, Pp, Np, W)
% Create Matrix Coefficients
    Mi = [rand(W,L) < Ip];
    Mp = [rand(W,L) < Pp];
    for x=1:W
        if rand(1) > Np                 % Create noise
            Mi(x,:) = zeros(1,L);
            Mp(x,:) = zeros(1,L);
        elseif sum(Mi(x,:)) == 0        % Ensure at least one '1' in I-frame part
            Mi(x,floor(rand(1)*L)+1) = 1;
        end
            
    end
    M=[Mi Mp]*1.0;
